//2009/08/29 23:13:39
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class DeckRearranging
{
public:
    string rearrange(string deck, vector <int> above)
    {
        string v;
        for (int i=0; i<above.size(); i++)
            v.insert(above[i], deck.substr(i, 1));
		return v;
    }
};
